
var $valType = 3;

// 更新验证码
var $val_code_img = $("#val_code_img");
if ($val_code_img) {
    $val_code_img.attr('src', '/verification/img?r=3&t=' + Date.parse(new Date()));
    $val_code_img.click(function () {
        $val_code_img.attr('src', '/verification/img?r=3&t=' + Date.parse(new Date()));
    });
}


var $forgotPasswordForm = $('#forgotPasswordForm');
if ($forgotPasswordForm) {
    $forgotPasswordForm.submit(function (e) {
        e.preventDefault();

        if (!$forgotPasswordForm.valid()) {
            return;
        }

        abp.ui.setBusy(
            null,
            abp.ajax({
                contentType: abp.formex.contentTypeJson,
                url: $forgotPasswordForm.attr('action'),
                data: JSON.stringify($forgotPasswordForm.serializeFormToObject())
            }).done(function (data) {
                window.location.href = data;
            }).fail(function () {
                $val_code_img.click();
            })
        );
    });

}




